package com.pureut.equipment.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pureut.equipment.domain.EquipmentDispatch;
import com.pureut.equipment.domain.EquipmentMaintenance;
import com.pureut.equipment.domain.EquipmentRepair;
import com.pureut.equipment.domain.EquipmentState;
import com.pureut.equipment.domain.dto.EquipmentRepairDto;
import com.pureut.equipment.domain.vo.EquipmentRepairVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 设备维修 mapper
 * @Author hl
 **/
@Mapper
public interface EquipmentRepairMapper extends BaseMapper<EquipmentRepair> {

    /**
     * 设备维修列表
     *
     * @param equipmentRepairVo 接受类
     * @return 设备维修列表
     */
    Page<EquipmentRepairDto> selectRepairList(@Param("equipmentRepairVo") EquipmentRepairVo equipmentRepairVo, @Param("page") Page<EquipmentRepairDto> page);

    /**
     * 维修派工
     *
     * @param equipmentDispatch 接受类
     * @return 1 成功 0 失败
     */
    int dispatchEquipmentRepair(EquipmentDispatch equipmentDispatch);


    /**
     * 执行维修
     *
     * @param equipmentMaintenance
     * @return 成功 1 失败 0
     */
    int maintenanceEquipmentRepair(EquipmentMaintenance equipmentMaintenance);

    /**
     * 提交审核
     *
     * @param equipmentState id
     * @return 成功 1 失败 0
     */
    int submitEquipmentRepair(EquipmentState equipmentState);

    /**
     * 查询单个设备维修列表
     *
     * @param repairId id
     * @return 设备维修列表
     */
    EquipmentRepairDto selectRepairById(long repairId);
}
